package com.csu.service.impl;

import com.csu.dao.BorrowInfoDao;
import com.csu.dao.impl.BorrowInfoDaoImpl;
import com.csu.entiry.BorrowInfo;
import com.csu.service.BorrowInfoService;

import java.util.List;

public class BorrowInfoServiceImpl implements BorrowInfoService {
    private final BorrowInfoDao borrowInfoDao = new BorrowInfoDaoImpl();

    @Override
    public List<BorrowInfo> getBorrowInfoList(int current, int size, String key) {
        return borrowInfoDao.getBorrowInfoList(current, size, key);
    }

    @Override
    public int getTotal(int current, int size, String key) {
        return borrowInfoDao.getTotal(current, size, key);
    }

    @Override
    public boolean addInfo(BorrowInfo borrowInfo) {
        return borrowInfoDao.addInfo(borrowInfo);
    }

    @Override
    public boolean removeInfo(int borrowId) {
        return borrowInfoDao.removeInfo(borrowId);
    }

    @Override
    public boolean updateInfo(BorrowInfo borrowInfo) {
        return borrowInfoDao.updateInfo(borrowInfo);
    }

    @Override
    public BorrowInfo getByBorrowId(int borrowId) {
        return borrowInfoDao.getByBorrowId(borrowId);
    }

    @Override
    public List<BorrowInfo> searchListByKey(String key) {
        return borrowInfoDao.searchListByKey(key);
    }
}
